import org.apache.hadoop.io.IntWritable;
import org.apache.hadoop.io.NullWritable;
import org.apache.hadoop.mapreduce.Reducer;

import java.io.IOException;

public class HomeworkReducer extends Reducer<NumberBean, NullWritable, IntWritable, NumberBean> {
    IntWritable count = new IntWritable(1);
    @Override
    protected void reduce(NumberBean key, Iterable<NullWritable> values, Context context) throws IOException, InterruptedException {
        for(NullWritable nullWritable : values){
            context.write(count, key);
            count.set(count.get() + 1);
        }
    }
}
